<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>时间线记录内存变化</title>
</head>
<body>
    <button id="btn">点我</button>

    <script>
        const arrlist = []


        function test() {
            for (let index = 0; index < 100000; index++) {
                document.body.appendChild(document.createElement("p"))
            }
            arrlist.push(new Array(1000000).join("x"))
        }

        document.getElementById("btn").addEventListener("click", test)
    </script>
</body>
</html>